package o;

import android.content.Context;
import androidx.annotation.NonNull;
import com.huawei.appgallery.foundation.application.pkgmanage.model.update.ApkUpgradeInfo;

public class dsu implements ceq {
    private cnw ˎ;
    private coa ˏ;
    private cny ॱ;

    public dsu() {
        fhz ˋ = fho.ˏ().ˋ("PackageManager");
        if (ˋ != null) {
            this.ˎ = (cnw) ˋ.ॱ(cnw.class);
            this.ˏ = (coa) ˋ.ॱ(coa.class);
            this.ॱ = (cny) ˋ.ॱ(cny.class);
        }
    }

    public boolean ˎ(Context context) {
        if (this.ˎ == null || (this.ˎ.ˋ(context) & 2) == 0) {
            return false;
        }
        return true;
    }

    public void ˊ(ApkUpgradeInfo apkUpgradeInfo) {
        if (this.ˏ != null) {
            cnz ˏ = this.ˏ.ˏ(apkUpgradeInfo.ᐝ());
            if (ˏ == cnz.UNINSTALLED) {
                apkUpgradeInfo.ˊ(0);
            } else if (ˏ == cnz.UNINSTALLED_PREDL) {
                apkUpgradeInfo.ˊ(1);
            }
        }
    }

    public long ॱ() {
        if (this.ˏ != null) {
            return this.ˏ.ˋ();
        }
        return 0;
    }

    public boolean ˊ(@NonNull Context context, @NonNull String str, int i) {
        if (this.ॱ != null) {
            return this.ॱ.ˋ(context, str, i);
        }
        return false;
    }

    public boolean ˋ(@NonNull Context context, long j) {
        return this.ॱ.ˎ(context, j);
    }

    public boolean ˊ(@NonNull Context context, @NonNull String str) {
        return this.ॱ.ˋ(context, str);
    }

    public boolean ॱ(Context context) {
        return eqh.ˎ().ˏ() && ˎ(context);
    }
}
